Neural Sensing in an Implantable Stimulator Device During the Provision of Active Stimulation

ABSTRACT

Techniques for sensing neural responses such as Evoked Compound Action Potentials (ECAPs) in an implantable stimulator device are disclosed. A first therapeutic pulse phase is followed by a second pulse phase, which phases may be of opposite polarities to assist with active charge recovery. The second pulse phase is formed so as to overlap in time with the arrival of the ECAP at a sensing electrode, which second phase may generally be longer and of a lower amplitude. In so doing, a stimulation artifact formed in a patient&#39;s tissue is rendered constant, and of a smaller amplitude, when the ECAP is sensed at the sensing electrode, which eases sensing by a sense amp circuit. Passive charge recovery may follow the second phase, which will not interfere with ECAP sensing that has already occurred.

CROSS REFERENCE TO RELATED APPLICATIONS

This is a non-provisional of U.S. Provisional Patent Application Ser.No. 62/825,982, filed Mar. 29, 2019, which is incorporated herein byreference in its entirety, and to which priority is claimed.

FIELD OF THE INVENTION

This application relates to Implantable Medical Devices (IMDs), and morespecifically to circuitry to assist with sensing neural signals in animplantable stimulator device.

INTRODUCTION

Implantable neurostimulator devices are devices that generate anddeliver electrical stimuli to body nerves and tissues for the therapy ofvarious biological disorders, such as pacemakers to treat cardiacarrhythmia, defibrillators to treat cardiac fibrillation, cochlearstimulators to treat deafness, retinal stimulators to treat blindness,muscle stimulators to produce coordinated limb movement, spinal cordstimulators to treat chronic pain, cortical and deep brain stimulatorsto treat motor and psychological disorders, and other neural stimulatorsto treat urinary incontinence, sleep apnea, shoulder subluxation, etc.The description that follows will generally focus on the use of theinvention within a Spinal Cord Stimulation (SC S) system, such as thatdisclosed in U.S. Pat. No. 6,516,227. However, the present invention mayfind applicability with any implantable neurostimulator device system.

An SCS system typically includes an Implantable Pulse Generator (IPG) 10shown in FIG. 1. The IPG 10 includes a biocompatible device case 12 thatholds the circuitry and a battery 14 for providing power for the IPG tofunction. The IPG 10 is coupled to tissue-stimulating electrodes 16 viaone or more electrode leads that form an electrode array 17. Forexample, one or more percutaneous leads 15 can be used havingring-shaped or split-ring electrodes 16 carried on a flexible body 18.In another example, a paddle lead 19 provides electrodes 16 positionedon one of its generally flat surfaces. Lead wires 20 within the leadsare coupled to the electrodes 16 and to proximal contacts 21 insertableinto lead connectors 22 fixed in a header 23 on the IPG 10, which headercan comprise an epoxy for example. Once inserted, the proximal contacts21 connect to header contacts 24 within the lead connectors 22, whichare in turn coupled by feedthrough pins 25 through a case feedthrough 26to stimulation circuitry 28 within the case 12.

In the illustrated IPG 10, there are thirty-two electrodes (E1-E32),split between four percutaneous leads 15, or contained on a singlepaddle lead 19, and thus the header 23 may include a 2×2 array ofeight-electrode lead connectors 22. However, the type and number ofleads, and the number of electrodes, in an IPG is application specificand therefore can vary. The conductive case 12 can also comprise anelectrode (Ec). In a SCS application, the electrode lead(s) aretypically implanted in the spinal column proximate to the dura in apatient's spinal cord, preferably spanning left and right of thepatient's spinal column. The proximal contacts 21 are tunneled throughthe patient's tissue to a distant location such as the buttocks wherethe IPG case 12 is implanted, at which point they are coupled to thelead connectors 22. In other IPG examples designed for implantationdirectly at a site requiring stimulation, the IPG can be lead-less,having electrodes 16 instead appearing on the body of the IPG 10 forcontacting the patient's tissue. The IPG lead(s) can be integrated withand permanently connected to the IPG 10 in other solutions. The goal ofSCS therapy is to provide electrical stimulation from the electrodes 16to alleviate a patient's symptoms, such as chronic back pain.

IPG 10 can include an antenna 27 a allowing it to communicatebi-directionally with a number of external devices used to program ormonitor the IPG, such as a hand-held patient controller or a clinician'sprogrammer, as described for example in U.S. Patent ApplicationPublication 2019/0175915. Antenna 27 a as shown comprises a conductivecoil within the case 12, although the coil antenna 27 a can also appearin the header 23. When antenna 27 a is configured as a coil,communication with external devices preferably occurs using near-fieldmagnetic induction. IPG 10 may also include a Radio-Frequency (RF)antenna 27 b. In FIG. 1, RF antenna 27 b is shown within the header 23,but it may also be within the case 12. RF antenna 27 b may comprise apatch, slot, or wire, and may operate as a monopole or dipole. RFantenna 27 b preferably communicates using far-field electromagneticwaves, and may operate in accordance with any number of known RFcommunication standards, such as Bluetooth, Zigbee, MICS, and the like.

Stimulation in IPG 10 is typically provided by pulses each of which mayinclude a number of phases such as 30 a and 30 b, as shown in theexample of FIG. 2A. Stimulation parameters typically include amplitude(current I, although a voltage amplitude V can also be used); frequency(F); pulse width (PW) of the pulses or of its individual phases; theelectrodes 16 selected to provide the stimulation; and the polarity ofsuch selected electrodes, i.e., whether they act as anodes that sourcecurrent to the tissue or cathodes that sink current from the tissue.These and possibly other stimulation parameters taken together comprisea stimulation program that the stimulation circuitry 28 in the IPG 10can execute to provide therapeutic stimulation to a patient.

In the example of FIG. 2A, electrode E4 has been selected as an anode(during its first phase 30 a), and thus provides pulses which source apositive current of amplitude +A to the tissue. Electrode E5 has beenselected as a cathode (again during first phase 30 a), and thus providespulses which sink a corresponding negative current of amplitude −A fromthe tissue. This is an example of bipolar stimulation, in which only twolead-based electrodes are used to provide stimulation to the tissue (oneanode, one cathode). However, more than one electrode may be selected toact as an anode at a given time, and more than one electrode may beselected to act as a cathode at a given time.

IPG 10 as mentioned includes stimulation circuitry 28 to form prescribedstimulation at a patient's tissue. FIG. 3 shows an example ofstimulation circuitry 28, which includes one or more current sourcecircuits 40 _(i) and one or more current sink circuits 42 _(i). Thesources and sinks 40 _(i) and 42 _(i) can comprise Digital-to-Analogconverters (DACs), and may be referred to as PDACs 40 _(i) and NDACs 42_(i) in accordance with the Positive (sourced, anodic) and Negative(sunk, cathodic) currents they respectively issue. In the example shown,a NDAC/PDAC 40 _(i)/42 _(i) pair is dedicated (hardwired) to aparticular electrode node ei 39. Each electrode node ei 39 is connectedto an electrode Ei 16 via a DC-blocking capacitor Ci 38, for the reasonsexplained below. The stimulation circuitry 28 in this example alsosupports selection of the conductive case 12 as an electrode (Ec 12),which case electrode is typically selected for monopolar stimulation.PDACs 40 _(i) and NDACs 42 _(i) can also comprise voltage sources.

Proper control of the PDACs 40 _(i) and NDACs 42 _(i) allows any of theelectrodes 16 to act as anodes or cathodes to create a current through apatient's tissue, R, hopefully with good therapeutic effect. In theexample shown (FIG. 2A), and during the first phase 30 a in whichelectrodes E4 and E5 are selected as an anode and cathode respectively,PDAC 404 and NDAC 425 are activated and digitally programmed to producethe desired current, A, with the correct timing (e.g., in accordancewith the prescribed frequency F and pulse widths PWa). During the secondphase 30 b (PWb), PDAC 405 and NDAC 424 would be activated to reversethe polarity of the current. More than one anode electrode and more thanone cathode electrode may be selected at one time, and thus current canflow through the tissue R between two or more of the electrodes 16.

Power for the stimulation circuitry 28 is provided by a compliancevoltage VH. As described in further detail in U.S. Patent ApplicationPublication 2013/0289665, the compliance voltage VH can be produced by acompliance voltage generator 29, which can comprise a circuit used toboost the battery 14's voltage (Vbat) to a voltage VH sufficient todrive the prescribed current A through the tissue R. The compliancevoltage generator 29 may comprise an inductor-based boost converter asdescribed in the '665 Publication, or can comprise a capacitor-basedcharge pump. Because the resistance of the tissue is variable, VH mayalso be variable, and can be as high as 18 Volts in one example.

Other stimulation circuitries 28 can also be used in the IPG 10. In anexample not shown, a switching matrix can intervene between the one ormore PDACs 40 _(i) and the electrode nodes ei 39, and between the one ormore NDACs 42 _(i) and the electrode nodes. Switching matrices allowsone or more of the PDACs or one or more of the NDACs to be connected toone or more anode or cathode electrode nodes at a given time. Variousexamples of stimulation circuitries can be found in U.S. Pat. Nos.6,181,969, 8,606,362, 8,620,436, and U.S. Patent ApplicationPublications 2018/0071520 and 2019/0083796. Much of the stimulationcircuitry 28 of FIG. 3, including the PDACs 40 _(i) and NDACs 42 _(i),the switch matrices (if present), and the electrode nodes ei 39 can beintegrated on one or more Application Specific Integrated Circuits(ASICs), as described in U.S. Patent Application Publications2012/0095529, 2012/0092031, and 2012/0095519, which are incorporated byreference. As explained in these references, ASIC(s) may also containother circuitry useful in the IPG 10, such as telemetry circuitry (forinterfacing off chip with telemetry antennas 27 a and/or 27 b), thecompliance voltage generator 29, various measurement circuits, etc.

Also shown in FIG. 3 are DC-blocking capacitors Ci 38 placed in seriesin the electrode current paths between each of the electrode nodes ei 39and the electrodes Ei 16 (including the case electrode Ec 12). TheDC-blocking capacitors 38 act as a safety measure to prevent DC currentinjection into the patient, as could occur for example if there is acircuit fault in the stimulation circuitry 28. The DC-blockingcapacitors 38 are typically provided off-chip (off of the ASIC(s)), andinstead may be provided in or on a circuit board in the IPG 10 used tointegrate its various components, as explained in U.S. PatentApplication Publication 2015/0157861.

Although not shown, circuitry in the IPG 10 including the stimulationcircuitry 28 can also be included in an External Trial Stimulator (ETS)device which is used to mimic operation of the IPG during a trial periodand prior to the IPG 10's implantation. An ETS device is typically usedafter the electrode array 17 has been implanted in the patient. Theproximal ends of the leads in the electrode array 17 pass through anincision in the patient and are connected to the externally-worn ETS,thus allowing the ETS to provide stimulation to the patient during thetrial period. Further details concerning an ETS device are described inU.S. Pat. No. 9,259,574 and U.S. Patent Application Publication2019/0175915.

Referring again to FIG. 2A, the stimulation pulses as shown arebiphasic, with each pulse at each electrode comprising a first phase 30a followed thereafter by a second phase 30 b of opposite polarity.(Although not shown, but as is well known, a short interphase period mayintervene between the phases 30 a and 30 b during which no current isactively driven by the DAC circuitry 40/42, which allows the DACcircuitry time to transition between the phases). Biphasic pulses areuseful to actively recover any charge that might be stored on capacitiveelements in the electrode current paths, such as the DC-blockingcapacitors 38, the electrode/tissue interface, or within the tissueitself. To recover all charge by the end of the second pulse phase 30 bof each pulse (Vc4=Vc5=0V), the first and second phases 30 a and 30 bare preferably charged balanced at each electrode, with the phasescomprising an equal amount of charge but of the opposite polarity. Inthe example shown, such charge balancing is achieved by using the samepulse width (PWa=PWb) and the same amplitude (|+A|=−A|) for each of thepulse phases 30 a and 30 b. However, the pulse phases 30 a and 30 b mayalso be charged balance if the product of the amplitude and pulse widthsof the two phases 30 a and 30 b are equal, as is known.

FIG. 3 shows that stimulation circuitry 28 can include passive recoveryswitches 41 _(i), which are described further in U.S. Patent ApplicationPublications 2018/0071527 and 2018/0140831. Passive recovery switches 41_(i) may be attached to each of the electrode nodes 39, and are used topassively recover any charge remaining on the DC-blocking capacitors Ci38 after issuance of the second pulse phase 30 b—i.e., to recover chargewithout actively driving a current using the DAC circuitry. Passivecharge recovery can be prudent, because non-idealities in thestimulation circuitry 28 may lead to pulse phases 30 a and 30 b that arenot perfectly charge balanced. Passive charge recovery typically occursafter actively-driven phases 30 a and 30 b have completed, and during atleast a portion 30 c (FIG. 2A) of the quiet periods between the pulses,by closing passive recovery switches 41 _(i). As shown in FIG. 3, theother end of the switches 41 _(i) not coupled to the electrode nodes 39are connected to a common reference voltage, which in this examplecomprises the voltage of the battery 14, Vbat, although anotherreference voltage could be used. As explained in the above-citedreferences, passive charge recovery tends to equilibrate the charge onthe DC-blocking capacitors 38 and other capacitive elements by placingthe capacitors in parallel between the reference voltage (Vbat) and thepatient's tissue. Note that passive charge recovery is illustrated assmall exponentially-decaying curves during 30 c in FIG. 2A, which may bepositive or negative depending on whether pulse phase 30 a or 30 b has apredominance of charge at a given electrode.

SUMMARY

A stimulator device is disclosed, which may comprise: a plurality ofelectrode nodes, each electrode node configured to be coupled to one ofa plurality of electrodes configured to contact a patient's tissue;stimulation circuitry programmed to form stimulation at at least two ofthe electrode nodes, wherein the stimulation at each of the twoelectrode nodes comprises a pulse comprising a first phase followed by asecond phase; and sensing circuitry configured to sense a neuralresponse to the stimulation at a sensing electrode node comprising oneof the electrode nodes, wherein the neural response is present at thesensing electrode node for a duration, wherein the sensing circuitry isconfigured to sense the neural response during the second phase.

In one example, the sensing electrode node is selectable from one of theelectrode nodes. In one example, the sensing circuitry is configured tosense the entire duration of the neural response during the secondphase. In one example, the sensing circuitry comprises a differentialamplifier, and wherein the differential amplifier receives the sensingelectrode node at a first input, and wherein the differential amplifierreceives a reference electrode node selected from one of the electrodenodes at a second input. In one example, the device further comprise aconductive case for housing the stimulation circuitry and the sensingcircuitry, wherein the conductive case comprises one of the plurality ofelectrodes, and wherein the case electrode is coupled to the referenceelectrode node. In one example, the first phase is of an oppositepolarity to the second phase at each of the at least two electrodenodes. In one example, the first and second phases are charge balancedat each of the at least two electrodes. In one example, the first andsecond phases are not charge balanced at each of the at least twoelectrodes. In one example, the device further comprises controlcircuitry configured with at least one algorithm, wherein the at leastone algorithm is configured to determine when the neural response willbe present at the sensing electrode node for the duration. In oneexample, the at least one algorithm is further configured to time thesecond phase at the at least two electrode nodes such that the secondphase will entirely overlap the neural response at the sensing electrodenode for the duration. In one example, the algorithm is furtherconfigured to determine an amplitude of the second phase. In oneexample, the algorithm is further configured to determine the amplitudeof the second phase such that the second phase is charge balanced withthe first phase at each of the at least two electrodes nodes. In oneexample, the stimulation circuitry comprises digital-to-analog circuitryconfigured to actively drive a current, wherein the second phase isactively driven by the digital-to-analog circuitry at each of the atleast two electrode nodes. In one example, the second phase is activelydriven with a constant current. In one example, the first phase isactively driven by the digital-to-analog circuitry at each of the atleast two electrode nodes. In one example, the first and second phasesare actively driven by the digital-to-analog circuitry with constantcurrents, wherein an amplitude of the constant current during the firstphase is larger than an amplitude of the constant current during thesecond phase at each of the at least two electrode nodes. In oneexample, the second phase comprises sub-phases of different amplitudes,wherein the sensing circuitry is configured to sense the neural responseonly during one of the sub-phases. In one example, the sensing circuitryis configured to sense the neural response only during one of thesub-phases having a lowest amplitude. In one example, the amplitude ofthe lowest amplitude sub-phase is constant. In one example, thestimulation circuitry comprises a plurality of passive charge recoveryswitches each coupled between one of the electrode nodes and a referencepotential. In one example, the stimulation circuitry is furtherprogrammed to provide passive charge recovery after the second phase byclosing at least the passive recovery switches coupled to the at leasttwo electrode nodes. In one example, the stimulation circuitry isfurther programmed to provide passive charge recovery between the firstand second phases by closing at least the passive recovery switchescoupled to the at least two electrode nodes. In one example, thestimulation circuitry is programmed to form a sequence of the pulses atthe at least two of the electrodes nodes. In one example, the firstphases are of opposite polarities at the at least two of the electrodesnodes, and wherein the second phases are of opposite polarities at theat least two of the electrodes nodes. In one example, each electrodenode is coupled to its associated electrode through a DC-blockingcapacitor. In one example, the stimulator device comprises animplantable pulse generator or an external trial stimulator.

A method is disclosed for operating a stimulator device, the stimulatordevice comprising a plurality of electrode nodes, each electrode nodeconfigured to be coupled to one of a plurality of electrodes configuredto contact a patient's tissue. The method may comprise: providingstimulation at at least two of the electrode nodes, wherein thestimulation at each of the two electrode nodes comprises at least onepulse comprising a first phase followed by a second phase; and sensing aneural response to the stimulation at a sensing electrode nodecomprising one of the electrode nodes, wherein the neural response ispresent at the sensing electrode node for a duration, wherein thesensing circuitry is configured to sense the neural response during thesecond phase.

In one example, the method further comprises selecting the sensingelectrode node from one of the electrode nodes. In one example, theentire duration of the neural response is sensed during the secondphase. In one example, the sensing circuitry comprises a differentialamplifier, and wherein the differential amplifier receives the sensingelectrode node at a first input, and wherein the differential amplifierreceives a reference electrode node selected from one of the electrodenodes at a second input. In one example, the stimulator device furthercomprises a conductive case, wherein the conductive case comprises oneof the plurality of electrodes, and wherein the case electrode iscoupled to the reference electrode node. In one example, the first phaseis of an opposite polarity to the second phase at each of the at leasttwo electrode nodes. In one example, the first and second phases arecharge balanced at each of the at least two electrodes. In one example,the first and second phases are not charge balanced at each of the atleast two electrodes. In one example, the method further comprisesdetermining using control circuitry in the stimulator device when theneural response will be present at the sensing electrode node for theduration. In one example, the second phase is timed at the at least twoelectrode nodes such that the second phase will entirely overlap theneural response at the sensing electrode node for the duration. In oneexample, the method further comprises determining an amplitude of thesecond phase. In one example, the method further comprises determine theamplitude of the second phase such that the second phase is chargebalanced with the first phase at each of the at least two electrodesnodes. In one example, the second phase is actively driven bydigital-to-analog circuitry in the stimulator device at each of the atleast two electrode nodes. In one example, the second phase is activelydriven with a constant current. In one example, the first phase isactively driven by the digital-to-analog circuitry at each of the atleast two electrode nodes. In one example, the first and second phasesare actively driven by the digital-to-analog circuitry with constantcurrents, wherein an amplitude of the constant current during the firstphase is larger than an amplitude of the constant current during thesecond phase at each of the at least two electrode nodes. In oneexample, the second phase comprises sub-phases of different amplitudes,wherein the neural response is sensed only during one of the sub-phases.In one example, the neural response is sensed only during one of thesub-phases having a lowest amplitude. In one example, the amplitude ofthe lowest amplitude sub-phase is constant. In one example, the methodfurther comprises providing passive charge recovery after the secondphase by closing passive recovery switches coupled at least to the atleast two electrode nodes. In one example, the method further comprisesproviding passive charge recovery between the first and second phases byclosing passive recovery switches coupled at least to the at least twoelectrode nodes. In one example, the stimulation comprises a sequence ofthe pulses at the at least two of the electrodes nodes. In one example,the first phases are of opposite polarities at the at least two of theelectrodes nodes, and wherein the second phases are of oppositepolarities at the at least two of the electrodes nodes. In one example,each electrode node is coupled to its associated electrode through aDC-blocking capacitor. In one example, the stimulator device comprisesan implantable pulse generator or an external trial stimulator.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 shows an Implantable Pulse Generator (IPG), in accordance withthe prior art.

FIGS. 2A and 2B show an example of stimulation pulses producible by theIPG, in accordance with the prior art.

FIG. 3 shows stimulation circuitry useable in the IPG, in accordancewith the prior art.

FIG. 4 shows an improved IPG having neural response sensing, and theability to adjust stimulation dependent on such sensing.

FIGS. 5A and 5B show leads producing stimulation and show differentialsensing of a neural response caused by the stimulation.

FIG. 6A shows a neural response as ideally sensed at a sensingelectrode, while FIG. 6B and 6C show how stimulation artifacts andpassive charge recovery can interfere with sensing the neural response.

FIG. 7 shows sense amp circuity useable to sense the neural response.

FIG. 8 shows modification of a biphasic pulse to provide a longer, loweramplitude second actively-driven pulse phase which overlaps the neuralresponse at the sensing electrode.

FIG. 9 shows a timing algorithm operable to determine when a neuralresponse starts and stops at a sensing electrode.

FIGS. 10A and 10B show adjustment algorithms useable in conjunction withthe timing algorithm to ensure that the second pulse phase will overlapthe neural response at the sensing electrode.

FIG. 11 shows operation of the timing and adjustment algorithms in anexternal device in communication with the IPG.

FIG. 12 shows a modification in which the second phase is split into twodifferent sub-phases of different amplitudes, with the neural responsesensed during the lower-amplitude sub-phase.

FIGS. 13A-13D show different examples in which the neural response canbe sensed during the lower-amplitude sub-phase.

FIGS. 14A and 14B show examples in which a longer-duration gap occursbetween the first and second pulse phases.

DETAILED DESCRIPTION

An increasingly interesting development in pulse generator systems, andin Spinal Cord Stimulator (SCS) pulse generator systems specifically, isthe addition of sensing capability to complement the stimulation thatsuch systems provide. For example, and as explained in U.S. PatentApplication Publication 2017/0296823, it can be beneficial to sense aneural response in neural tissue that has received stimulation from anSCS pulse generator. One such neural response is an Evoked CompoundAction Potential (ECAP). An ECAP comprises a cumulative responseprovided by neural fibers that are recruited by the stimulation, andessentially comprises the sum of the action potentials of recruitedfibers when they “fire.” An ECAP is shown in FIG. 4, and comprises anumber of peaks that are conventionally labeled with P for positivepeaks and N for negative peaks, with P1 comprising a first positivepeak, N1 a first negative peak, P2 a second positive peak and so on.Note that not all ECAPs will have the exact shape and number of peaks asillustrated in FIG. 4, because an ECAP's shape is a function of thenumber and types of neural fibers that are recruited and that areinvolved in its conduction. An ECAP is generally a small signal, and mayhave a peak-to-peak amplitude on the order of tens of microVolts to tensof milliVolts.

Also shown in FIG. 4 is circuitry for an IPG 100 that is capable ofproviding stimulation and sensing a resulting ECAP or other neuralresponse or signal. The IPG 100 includes control circuitry 102, whichmay comprise a microcontroller for example such as Part Number MSP430,manufactured by Texas Instruments, which is described in data sheets athttp://www.ti.com/lsds/ti/microcontroller/16-bit msp430/overview.page?DCMP=MCU_other& HQS=msp430, which is incorporated herein by reference.Other types of controller circuitry may be used in lieu of amicrocontroller as well, such as microprocessors, FPGAs, DSPs, orcombinations of these, etc. Control circuitry 102 may also be formed inwhole or in part in one or more Application Specific Integrated Circuits(ASICs), such as those described earlier. The disclosed circuitry andtechniques can also be implemented in an ETS implantable stimulator,although this isn't further discussed.

The IPG 100 also includes stimulation circuitry 28 to producestimulation at the electrodes 16, which may comprise the stimulationcircuitry 28 shown earlier (FIG. 3). A bus 118 provides digital controlsignals from the control circuitry 102 (and possibly from an ECAPalgorithm 124, described below) to one or more PDACs 40 _(i) or NDACs 42_(i) to produce currents or voltages of prescribed amplitudes (A) forthe stimulation pulses, and with the correct timing (PW, f). As notedearlier, the DACs can be powered between a compliance voltage VH andground. As also noted earlier, but not shown in FIG. 4, switch matricescould intervene between the PDACs and the electrode nodes 39, andbetween the NDACs and the electrode nodes, to route their outputs to oneor more of the electrodes, including the conductive case electrode 12(Ec). Control signals for switch matrices, if present, may also becarried by bus 118. Notice that the current paths to the electrodes 16include the DC-blocking capacitors 38 described earlier, which providesafety by preventing the inadvertent supply of DC current to anelectrode and to a patient's tissue. Passive recovery switches 41 _(i)introduced earlier are also shown in FIG. 4.

IPG 100 also includes sensing circuitry 115, and one or more of theelectrodes 16 can be used to sense neural responses such as the ECAPsdescribed earlier. In this regard, each electrode node 39 is furthercoupleable to a sense amp circuit 110. Under control by bus 114, amultiplexer 108 can select one or more electrodes to operate as sensingelectrodes by coupling the electrode(s) to the sense amps circuit 110 ata given time, as explained further below. Although only one multiplexer108 and sense amp circuit 110 is shown in FIG. 4, there could be morethan one. For example, there can be four multiplexer 108/sense ampcircuit 110 pairs each operable within one of four timing channelssupported by the IPG 100 to provide stimulation. The analog waveformcomprising the ECAP is preferably converted to digital signals by one ormore Analog-to-Digital converters (ADC(s)) 112, which may sample thewaveform at 50 kHz for example. The ADC(s) 112 may also reside withinthe control circuitry 102, particularly if the control circuitry 102 hasA/D inputs. Multiplexer 108 can also provide a DC reference voltage,Vamp (e.g., GND), to the sense amp circuit 110, as is useful in asingle-ended sensing mode.

So as not to bypass the safety provided by the DC-blocking capacitors38, the input to the sense amp circuitry 110 is preferably taken fromthe electrode nodes 39, and so the DC-blocking capacitors 38 intervenebetween the electrodes 16 where the ECAPs are sensed and the electrodenodes 39. However, because the DC-blocking capacitors 38 will pass ACsignals while blocking DC components, the AC ECAP signal will passthrough the capacitors 38 and is still readily sensed by the sense ampcircuit 110. In other examples, the ECAP may be sensed directly at theelectrodes 16 without passage through intervening capacitors 38.

As shown, an ECAP algorithm 124 is programmed into the control circuitry102 to receive and analyze the digitized ECAPs. One skilled in the artwill understand that the ECAP algorithm 124 can comprise instructionsthat can be stored on non-transitory machine-readable media, such asmagnetic, optical, or solid-state memories within the IPG 100 (e.g.,stored in association with control circuitry 102).

In the example shown in FIG. 4, the ECAP algorithm 124 operates withinthe IPG 100 to determine one or more ECAP features, which may includebut are not limited to:

-   -   a height of any peak (e.g., H_N1) present in the ECAP;    -   a peak-to-peak height between any two peaks (such as H_PtoP from        N1 to P2);    -   a ratio of peak heights (e.g., H_N1/H_P2);    -   a peak width of any peak (e.g., the full width half maximum of a        N1, FWHM_N1);    -   an area under any peak (e.g., A_N1);    -   a total area (A_tot) comprising the area under positive peaks        with the area under negative peaks subtracted or added;    -   a length of any portion of the curve of the ECAP (e.g., the        length of the curve from P1 to N2, L_P1toN2)    -   any time defining the duration of at least a portion of the ECAP        (e.g., the time from P1 to N2, t_P1toN2);    -   a time delay from stimulation to issuance of the ECAP, which is        indicative of the neural conduction speed of the ECAP, which can        be different in different types of neural tissues;    -   any mathematical combination or function of these variables        (e.g., H_N1/FWHM_N1 would generally specify a quality factor of        peak N1).

Once the ECAP algorithm 124 determines one or more of these features, itmay then adjust the stimulation that the IPG 100 provides, for exampleby providing new data to the stimulation circuitry 28 via bus 118. Thisis explained further in U.S. Patent Application Publications2017/0296823 and 2019/0099602, which are incorporated herein byreference in their entireties. In one simple example, the ECAP algorithm124 can review the height of the ECAP (e.g., its peak-to-peak voltage),and in closed loop fashion adjust the amplitude of the stimulationcurrent to try and maintain the ECAP to a desired value. The ECAPalgorithm 124 can further include sub-algorithms, such as a timingalgorithm 150 and an adjustment algorithm 170, which are describedfurther below.

FIGS. 5A and 5B show a percutaneous lead 15 (a paddle lead 19 or otherlead could also be used), and show the stimulation program example ofFIG. 2A in which electrodes E4 and E5 are used to produce biphasicpulses in a bipolar mode of stimulation, with (during the first phase 30a) E4 comprising an anode and E5 a cathode, although other electrodearrangements (e.g., tripoles, etc.) could be used as well. Suchstimulation produces an electromagnetic (EM) field 130 in a volume ofthe patient's tissue around the selected electrodes. Some of the neuralfibers within the EM field 130 will be recruited and fire, particularlythose proximate to the cathodic electrode E5. Hopefully the sum of theneural fibers firing will mask signals indicative of pain in an SCSapplication, thus providing the desired therapy. The recruited neuralfibers in sum produce an ECAP, which can travel both rostrally towardthe brain and caudally away from the brain. The ECAP passes through thespinal cord by neural conduction with a speed which is dependent on theneural fibers involved in the conduction. In one example, the ECAP maymove at a speed of about 5 cm/1 ms.

The ECAP is preferably sensed differentially using two electrodes, andFIGS. 5A and 5B show different examples. In FIG. 5A, a single electrodeE8 on the lead 15 is used for sensing (S+), with another signal beingused as a reference (S−). In this example, the sensing reference S−comprises a more distant electrode in the electrode array 17, or (asshown) the case electrode Ec. Reference S− could also comprise a fixedvoltage provided by the IPG 100, such as ground or Vamp (FIG. 4), inwhich case sensing would be said to be single-ended instead ofdifferential. In FIG. 5B, two lead-based electrodes are used forsensing, with such electrodes either being adjacent or at leastrelatively close to one another. Specifically, in this example,electrode E8 is again used for sensing (S+), with adjacent electrode E9providing the reference (S−). This could also be flipped, with E8providing the reference (S−) for sensing at electrode E9 (S+). Sensing agiven ECAP at different electrodes can allow the ECAP algorithm 124 tounderstand the time difference between the arrival of the ECAP at eachof the electrodes. If the distance x between the electrodes is known,the ECAP algorithm 124 can then compute speed of the ECAP. As notedabove, ECAP speed is indicative of the neural fibers involved in neuralrecruitment and conduction, which can be interesting to know in its ownright, and which may be useful to the ECAP algorithm 124 in adjustingthe stimulation provided by the stimulation circuitry 28.

FIG. 6A shows an ECAP as ideally sensed at the sensing electrode S+(e.g., E8). In this example, it is assumed that sensing electrode E8 isat a distance d=12 mm away from the stimulation electrodes (e.g., E5),assuming the electrodes in the array are spaced at a distance x=4 mmapart. If one assumes that the ECAP travels at a speed of 5 cm/ms(again, this could vary depending on the neural tissue involved), theECAP would start to pass the sensing electrode S+ at a time t1=0.24 ms.The ECAP itself is also spread in time (t_(ECAP)). This duration isagain variable, but in FIG. 6A it is assumed that the ECAP is present atthe sensing electrode S+ for one millisecond as a reasonable nominalvalue (i.e., t_(ECAP)=1 ms). Therefore, the ECAP will finish passing thesensing electrode S+ in this example at a time t2=t1+t_(ECAP) (e.g.,t2=1.24 ms).

FIG. 6B shows waveforms for the stimulation program, as well as thesignals that would appear in the tissue at sensing electrode E8 (S+). Aswell as including the ECAP signal to be sensed (between times t1 andt2), the signal at the sensing electrode S+ also includes a stimulationartifact 134. The stimulation artifact 134 comprises a voltage that isformed in the tissue as a result of the stimulation, i.e., as result ofthe EM field 130 produced at stimulating electrodes E4 and E5. Asdescribed in U.S. Patent Application Publication 2019/0299006, which isincorporated herein by reference in its entirety, the PDACs and NDACsused to form the currents in the tissue have high output impedances.This can cause the voltage in the tissue to vary between ground and thecompliance voltage VH used to power the DACs, which as noted earlier canbe a high voltage (on the order of Volts). The magnitude of thestimulation artifact 134 at a given sensing electrode S+ or itsreference S− can therefore be high (e.g., from milliVolts to Volts), andsignificantly higher than the magnitude of the ECAP. The magnitude ofthe stimulation artifact 134 at the sensing electrodes S+ and S− isdependent on many factors. For example, the stimulation artifact 134will be larger if the sensing electrodes are closer to the stimulatingelectrodes (E4, E5). The stimulation artifact 134 is also generallylarger during the provision of the pulses (during phases 30 a and 30 b),although it may still be present even after the pulse (i.e., the lastphase 30 b of the pulse) has ceased due to the capacitive nature of thetissue, which keeps the electric field 130 from dissipating immediately.As shown, the polarity of the stimulation artifact 134 varies betweenthe phases 30 a and 30 b of the stimulation pulses when the currentreverses polarity. Although the sensing artifact 134 and the ECAP arefor simplicity shown separately in FIG. 6B, in reality they wouldsuperimpose (add) at the sensing electrode S+. Note that the magnitudesof the sensing artifact 134 and the ECAP are not necessarily drawn toscale; in particular, the sensing artifact 134 may be much larger.

The relatively large-signal background stimulation artifact 134 can makeresolution and sensing of the small-signal ECAP difficult at the senseamp circuit 110. To ameliorate this concern, it can be beneficial to usea sensing electrode S+ that is far away from the stimulating electrodes.See, e.g., U.S. patent application Ser. No. 16/661,549, filed Oct. 23,2019, which is incorporated herein by reference in its entirety. Thiscan be beneficial because the stimulation artifact 134 would be smallerat a more-distant sensing electrode, and because the ECAP would pass adistant sensing electrode at a later time when the stimulation artifact134 might have dissipated. However, using a distant sensing electrode isnot always possible or practical. For one, the electrode array 17 maysimply not be large enough, and therefore no electrode may be suitablyfar enough away from the stimulating electrodes to ideally operate asthe sensing electrode. Likewise, the magnitude of the ECAP alsodiminishes as distance from the stimulating electrodes increases, andtherefore while the stimulation artifact 134 would be smaller at a moredistant sensing electrode, so too would the ECAP, again making sensingdifficult.

Assume then that E8 remains the sensing electrode in FIG. 6B. In thisexample, it is assumed that the pulses phases 30 a and 30 b haverelatively long pulse widths, with both PWa of the first phase 30 a andPWb of the second phase 30 b equaling 0.25 ms. In sum, pulses areactively driven by the DAC circuitry (40/42) from 0 to 0.5 ms, and thestimulation artifact 134 is therefore predominant during the period.(This period may include an interphase period of short duration betweenphases 30 a and 30 b although for simplicity this isn't shown).Unfortunately, this simulation artifact 134 overlaps in time with theECAP at the sensing electrode S+, which again occurs between 0.24 (t1)and 1.24 ms (t2). This makes sensing of the ECAP difficult at thesensing electrode S+. First, the stimulation artifact 134 may besignificantly larger than the small-signal ECAP. Further, thestimulation artifact 134 changes significantly during the time that theECAP is present at the sensing electrode S+. In particular, at 0.25 ms,the stimulation artifact 134 changes polarity (from phases 30 a to 30b), swinging from negative to positive values. Further, the stimulationartifact 134 falls from positive values to 0 at 0.5 ms (at the end ofphase 30 b), which in this example occurs in the middle of the ECAP.Because the ECAP is superimposed on the stimulation artifact 134, thismakes resolution of the ECAP at the sense amp circuit 110 difficult.

FIG. 6C alleviates this sensing problem to some extent by making thepulse widths smaller. In this example, PWa and PWb have been reduced to0.12 ms each. As such, the stimulation artifact 134 largely ends at 0.24ms (at the end of phase 30 b) when the ECAP first starts to appear atthe sensing electrode S+ (at t1). As such, the ECAP and stimulationartifact 134 do not significantly overlap at the sense electrode S+, andthis is further true if the pulse widths are reduced further. However,this solution may not be ideal. First, adjusting the pulse widths maysimply not be possible, as they may not be what is needed to provideadequate stimulation therapy for the patient. Also, simply reducing thepulse widths to avoid overlap with the ECAP may not be possible if theECAP travels relatively fast.

Furthermore, although the ECAP may no longer overlap significantly withthe stimulation artifact 134 in FIG. 6C, the ECAP does still overlapduring a period 30 c where it may be desirable to provide passive chargerecovery after the active pulses phases 30 a and 30 b have completed. Asnoted earlier, passive charge recovery involving closing passive chargerecovery switches 41 i (FIG. 4), which shorts the electrode nodes ei 39to a reference potential (such as Vbat). Even if the switch 418 atsensing electrode E8 is not closed, the effect of closing some of theswitches will cause a current to passively flow in the tissue, whichalso causes a variable voltage artifact in the tissue as well (notshown). See, e.g., U.S. Patent Application Publication 2018/0140831. Inshort, passive charge recovery makes sensing of the ECAP difficult asit—like the stimulation artifact 134—can create a time varying voltagein the tissue that is significantly larger than the ECAP. Note that theprovision of passive recovery 30 c in FIG. 6B is also problematic,because there as well the passive charge recovery period 30 c againoverlaps in time with the ECAP to some extent.

As noted earlier, an ECAP is preferably sensed differentially usingelectrodes S+ and S−, which are both exposed to the tissue, thereforeallowing the artifacts in the tissue (i.e., stimulation artifacts 134 orartifacts related to passive charge recovery) to be subtracted from theECAP measurement to at least some degree. A sense amp circuit 110 thatprovides differential sensing is shown in FIG. 7. The sense amp circuit110 includes a differential amplifier 111. Also shown is an example ofthe circuitry within the differential amplifier 111, although it shouldbe noted that many different differential amplifier circuits exist andcan be used in sense amp circuit 110 as well. Sensing electrode S+ andsensing reference electrode S− are coupled through the DC-blockingcapacitors 38 (if used) to derive signals X+ and X− at the electrodenodes 39 that are presented to the positive and negative inputs of thedifferential amplifier 111. Signals X+ and X− will be largely the sameas S+ and S− present at the selected sensing electrodes, but with DCsignal components removed. X+ and X− are provided to the gates (controlterminals) of transistors M+ and M− in the differential amplifier 111.The drains of the transistors M+ and M− are connected to differentialoutputs D+ and D−, which in turn are coupled to the amplifier's powersupply voltage Vdd via resistances R+ and R−. The sources of thetransistors M+ and M− are connected to ground as the other power supplyvoltage through a common bias transistor Mb, which sets the totalcurrent Ib that, in sum, can pass through each of the legs (I+, I−) ofthe differential amplifier. Resistances R+ and R− are equal and arerepresented as simple resistors, although active devices (e.g., PMOStransistors) could also be used. The output of the amplifier 111, Vo,equals the difference in the voltages at outputs D+ and D−, which inturn is influenced by the difference in the signals present at X+ andX−. Signals X+ and X−, if different (e.g., if an ECAP is present at S+),will turn transistors M+ and M− on to different degrees, thus causingdifferent currents I+ and I− to flow through each leg. This producesdifferent voltage drops across the resistances R+ and R−, and thusdifferent voltages at D+ and D−. In short, Vo=D+−D−=A1(X+−X−), where A1is the gain of the amplifier 111.

The differential amplifier 111 may provide its output to variousprocessing circuits 147 prior to presentation to the control circuitry102 and the ECAP algorithm 124. For example, the differential amplifier111's differential output Vo may be provided to the inputs of anotherdifferential amplifier 146, and to still further differential amplifiersin series, etc. This can be helpful in increasing the gain of thedetected ECAP signal, because the gains of each amplifier stage willmultiply (A1*A2, etc.). A follower circuit or buffer could also be usedin series as part of the processing circuitry 147 between thedifferential amplifier 111 and the ADC 112 but such stages are notshown. Further, the processing circuitry 147 may include a Low PassFilter (LPF) 148 to remove high-frequency components in the ECAP signalthat are not of interest, or that are inconsistent with the rate atwhich the ADC 112 will sample the signal. In one example, the LFP 148removes frequency components of 25 kHz or higher. Processing circuitry147 may comprise part of the control circuitry 102.

To prevent damage to or improper operation of the differential amplifier111 (i.e., the first differential amplifier in series), inputs X+ and X−may be provided with clamping circuits 142+ and 142− respectively. Inthe example shown, clamping circuit 142+ comprises a serial connectionof diodes 144 a and 144 b which are forward biased between a low clampreference voltage reference (Vcl) and a high clamp reference voltage(Vch), and with signal X+ connected to a node between the diodes. Vcland Vch preferably comprise ground and the power supply voltage Vdd(e.g., 3.3V). In this example, it is assumed that the diodes 144 a and114 b have a forward biased threshold voltage (Vtd) of 0.6V. Diode 144 awould conduct (turn on) if the voltage at X+ is less than −0.6 Volts.Because such conductance is of very low resistance, X+ is effectivelyclamped to a minimum of Vmin=−0.6 Volts. If it is assumed that Vdd=3.3V, diode 144 b would conduct if X+ is greater than 3.9V Volts, whichwould clamp X+ to a maximum of Vmax=3.9V. If the voltage at X+ is at orbetween −0.6 and 3.9 Volts, neither diode 144 a nor 144 b in clampingcircuit 142+ would conduct. Clamping circuit 142− is similar, butconnects to signal X−, and so similarly clamps X− to a voltage at orbetween −0.6 and 3.9 Volts. Modifications may be made to the clampingcircuits 142+ and 142− to adjust the window of permissible voltages atwhich clamping does not occur. For example, Vcl and Vch could begenerated by their own generator circuits to produce unique valuesdifferent from ground and Vdd; different numbers of diode could be used;Zener diodes could be used that break down and thus clamp X+ or X− atspecified reverse bias voltages; etc.

Also shown in FIG. 7 are blanking switches 141+ and 141− which arerespectively used to pass signals at X+ and X− to the differentialamplifier. Blanking switches 141+ and 141− can be used to protect thedifferential amplifier 111, and specifically to protect the amplifier111 from receiving voltages that are too high at signals X+ and X−.(Note however the clamping circuits 142+ and 142−, which limit thevoltages at X+ and X−, may alleviate the need for blanking switches 141+and 141− to some degree). Blanking switches can be used in conjunctionwith the disclosed technique, as described further below. Note thatblanking switches 141+ and 141− can comprise logic switches used toroute the electrode nodes 39 to the sense amp circuit 110. For example,blanking switches 141+ and 141− can comprise switches within themultiplexer 108 (FIG. 4), or they may comprise independent switches.

The sense amp circuit 110 may further include DC-level shifting circuits143+ and 143− to set signals X+ and X− to a DC voltage referenceconsistent with the input requirements for the differential amplifier111. The differential amplifier 111 can only operate reliably if signalsX+ and X− are of a magnitude that causes current I+ and I− to flow ineach leg of the amplifier. In this regard, to sense the small-signalECAP, X+ and X− should be higher than the threshold voltage of theamplifier's input transistors M+ and M− (e.g., greater than Vtt=0.7 V).It is further preferred that X+ and X− not exceed the power supplyvoltage Vdd of the differential amplifier (e.g., Vdd=3.3V) for properamplifier operation. Accordingly, signals provided to the differentialamplifier 111 are preferably referenced with respect to a DC voltagereference within this operating range. This reference could comprise ½Vdd (e.g., 1.65 V), which comprises a midpoint between Vdd and ground.More preferably, the DC voltage reference could comprise ½ (Vdd−Vtt)+Vtt(e.g., 2.0 V), as this value would be midpoint within the operatingrange 0.7V and 3.3V, and thus allow X+ and X− to symmetrically swing+/−1.3V from the reference while still providing an input magnitudesuitable to operate the differential amplifier 111. While such circuitscan take different forms, in the example shown the DC-level shiftingcircuits 143+ and 143− comprise resistor ladders, comprising resistorsRa and Rb in series biased between Vdd and ground, with signals X+ andX− connected to nodes between the resistors. This sets the DC voltagereference of both X+ and X− to Ra/(Ra+Rb)*(Vdd−ground). Thus by settingthe values of Ra and Rb appropriately, the DC voltage reference can beset to any desired value between Vdd and ground, such as 2.0 V. ACsignals then coupling to X+ and X− through the capacitors 38 (such asthe ECAP and/or the stimulation artifact 134) will then be referenced to(and ride on top off) this DC voltage reference. As a general matter,this allows the differential amplifier 111 to be affected by the ECAP atX+, because the superposition of the ECAP and the DC voltage referencewill cause a change in current I+. Preferably, Ra and Rb are largeresistances, such 1 MegaOhm or higher.

Because the stimulation artifact 134 is present at both the sensingelectrode S+ and reference electrode S−, the differential amplifier 111will ideally subtract artifacts in the tissue (i.e., stimulationartifact 134 and artifacts related to passive charge recovery) as acommon mode voltage from the output (Vo), leaving only the ECAP to besensed. However, the magnitude of such artifacts may not be exactly thesame at sensing electrodes S+ and S−, which is not surprising as each isnecessarily located at a different distance from the stimulatingelectrodes. Thus, common mode removal of such artifacts by thedifferential amplifier 111 may be not be perfect. Furthermore, it isdifficult to design the differential amplifier 111 to resolve the ECAPwhen the artifacts are both relatively large and varying over time. Thisis a particular problem in the scenarios discussed earlier withreference to FIGS. 6B and 6C, where the ECAP overlaps in time at thesensing electrode S+ with the stimulation artifact 134 and passiverecovery artifacts to significant degrees.

Conventional wisdom, as described earlier, teaches that it is notdesirable to sense an ECAP during the active provision of pulses to thetissue. Again, this is because the stimulation artifact 134 may be largeor changing during such periods. However, contrary to this conventionalwisdom, the inventors have devised a new ECAP sensing strategy, which isshown in a first example in FIG. 8. Generally speaking, the strategyshown in FIG. 8 senses the ECAP during the second active charge recoveryphase 30 b. This phase 30 b is made longer so as to preferably entirelyoverlap with the ECAP at the sensing electrode S+. This modification isshown in FIG. 8 with contrast to FIG. 6B illustrated earlier.

In FIG. 6B, the biphasic pulses comprises two phases 30 a and 30 b, withphase 30 a having an amplitude at electrode E4 of + Aa and a pulse widthof PWa, and with phase 30 b having an amplitude of −Ab and a pulse widthof PWb. (The polarities of these currents are flipped at electrode E5).Amplitudes |Aa| and |−Ab| can be different, as can pulse widths PWa andPWb, but the phases 30 a and 30 b are preferably charge balanced toprovide for active charge recovery as explained earlier. That is,|+Aa|*PWa=|+Q|=|−Ab|*PWb=|−Q|. As described earlier with respect to FIG.6B, the timing of this pulse creates problems when sensing an ECAP,because the stimulation artifact is large and changing when the ECAP ispresent at the sensing electrode S+.

Therefore, in FIG. 8, the second pulse phase 30 b has been modified.Specifically, the pulse width has been lengthened from PWb to PWb′, suchthat the second pulse phase 30 b now entirely overlaps the ECAP at thesensing electrode. To keep the first and second phases 30 a and 30 bcharge balanced, the amplitude of the second phase 30 b is accordinglyreduced from −Ab to −Ab′, such that |+Aa|*PWa=|+Q|=|−Ab′|*PWb′=|−Q|.

Thus, the ECAP is specifically sensed during the actively-driven secondpulse phase 30 b, and hence during at least a portion of the sensingartifact 134. This benefits ECAP sensing in a few ways.

First, although the sensing artifact 134 is still present during thesecond phase 30 b when the ECAP is present at the sensing electrode,this artifact is smaller, because the amplitude of the current has beenreduced from −Ab to −Ab′. This assists sensing by the differentialamplifier 111 (FIG. 7), as the differential amplifier can more easilyprocess (i.e., subtract out) a smaller common mode voltage that iscloser to being on par with the magnitude of the ECAP.

Second, by extending the duration of the second pulse phase 30 b, thisphase no longer starts or ends during (in the middle of) the ECAP at thesensing electrode S+. This also eases sensing because the stimulationartifact 134 is relatively constant during the ECAP at the sensingelectrode S+.

Third, if desired, passive recharge during period 30 c can occur afterprovision of the (extended) second pulse phase 30 b. At this point, theECAP has already been sensed, and thus passive charge recovery can occurwithout conflict to ECAP sensing.

Fourth, stimulation therapy to the patient is not significantly altered.Generally, the first phase 30 a of a biphasic pulse creates significanttherapeutic effect in the patient, and thus the amplitude Aa and pulsewidth PWa are generally tailored for the patient. In this example, thesepulse parameters Aa are PWa not altered. The second pulse phases 30 b,while necessary for active charge recovery, is generally nottherapeutically significant and thus can be changed without significantimpact to the patient.

Note that there can be practical limits to the solution of FIG. 8. Forexample, if the pulses are of high frequency F, there may not besufficient time between subsequent pulses to fit an extended secondpulse phase 30 b (and possibly also a passive recovery period 30 c).However, this problem can simply be mitigated by not providing asubsequent pulse until after ECAP measurement has completed. This shouldnot be significantly problematic to patient therapy, as ECAPmeasurements would normally not be taken after each pulse, but insteadonly need to be taken occasionally; occasionally delaying or missing atherapeutic pulse will not significantly affect stimulation therapy. Itmay also be the case that the ECAP overlaps with the first pulse phase30 a at the sensing electrode S+, i.e., t1 may be smaller than PWa. Thiscould impair ECAP sensing. However, given the timings normally involvedin stimulation therapy, such overlaps would not be frequent as apractical matter, and could be mitigated in other manners, such as bychoosing a sensing electrode S+ that is farther from the stimulatingelectrodes.

In the disclosed technique, as shown in FIG. 8, blanking should notoccur during the second pulse phases 30 b when the ECAP is sensed. Thatis, switches such as 141+ and 141− (FIG. 7) to the inputs of thedifferential amplifier 111 should be closed to allow sensed signals S+and S− (and X+ and X−) to reach the inputs to the amplifier. Duringfirst phase 30 a, blanking can occur—i.e., switches 141+ and 141− can beopened. This can help protect the differential amplifier 111 fromsaturating, which may occur if the stimulation artifact 134 is largeduring the first phase. That being said, it is not strictly necessary toblank during the first phase 30 a, particularly if clamping circuits142+ and 142− are used to limit the voltages on X+ and X−.

FIGS. 9 through 10B disclose optional algorithms 150, 170, and 170′ thatcan be used to adjust the second pulse phase 30 b to assist with ECAPsensing. FIG. 9 discloses a timing algorithm 150 which determines whenan ECAP will start (t1) and finish (t2) appearing at a sensing electrodeS+ that has been chosen for ECAP sensing. The timing algorithm 150 canreceive as inputs, or be programmed with, the selected sensingelectrode(s) (e.g., S+=E8) and stimulating electrodes (e.g., E4, E5),and the distance (x) between electrodes in the electrode array (e.g., 4mm). From this, the algorithm 150 can compute the distance (d) betweenthe stimulation and sensing electrodes (e.g., 12 mm). The timingalgorithm 150 can also receive, or be programmed with, an expected ECAPspeed (e.g., 5 cm/ms). Note that this speed can be an estimated speed,or a speed that is actually measured by the IPG. From distance d and theECAP speed, a time t1 at which the ECAP will first appear at the sensingelectrode can be determined (e.g., d/speed=0.24 ms). The timingalgorithm 150 can also receive, or be programmed with, an expected ECAPduration (t_(ECAP)=1 ms). Again, this value can also be measured in theIPG. This allows a time t2 at which the ECAP will finish appearing atthe electrode to be computed (e.g., t2=t1+t_(ECAP)). If necessary, t1and t2 can also be adjusted to provide additional margin—e.g., t1 can beslightly lowered and t2 can be slightly increased to ensure that t1 andt2 are suitable for detecting the ECAP (using adjustment algorithm 170which follows).

Although not shown, timing algorithm 150 may also determine t1 and t2using measurements alone. For example, short test pulses of low pulsewidths can be used which are unlikely to produce significant artifacts,with the resulting ECAP measured by the sense amp circuitry 110. Thus,t1 and t2 may be determined empirically.

Once t1 and t2—the start and finish of the ECAP at the sensing electrodeS+—have been determined using timing algorithm 150, an adjustmentalgorithm 170 may use these values to determine how to adjust aprescribed pulse, as shown in FIG. 10A. In particular, adjustmentalgorithm 170 can adjust the second active-recovery phase 30 b to ensurethat it is long enough to overlap with the ECAP at the sensing electrodeS+. In this regard, pulse parameters for a prescribed biphasicpulse—presumably a pulse determined to provide adequate patienttherapy—are received, which in this example comprises parameters for afirst phase 30 a (Aa, PWa), and a second phase 30 b (Ab, PWb). It isassumed in this example that such a prescribed pulse is charge balanced,as discussed above.

The adjustment algorithm 170 as first step can, optionally, assess thetiming of the first pulse phase (PWa) to determine whether it is smallerthan t1. As discussed earlier, if PWa is not smaller than t1, this canbe problematic to ECAP sensing, because the ECAP would be present at thesensing electrode S+ when the stimulation artifact 134 is changing(between phases 30 a and 30 b). If PWa is not less than t1, theadjustment algorithm 170 could take certain actions, such as adjustingPWa to make it less than t1 (even though this could change the therpayprovided by first phase 30 a), or choosing a new sensing electrode S+that might be further away from the stimulating electrodes (as discussednext with respect to FIG. 10B). This step may not be necessary if it isknown a priori that PWa<t1, and therefore that the ECAP should notoverlap with the first phase 30 a of the pulse. Note that choosing a newsensing electrodes would change the timing t1 and t2 at which the ECAPwould start and finish at that new sensing electrode, and therefore thenewly chosen sensing electrode S+ can be passed back to the timingalgorithm 150 (FIG. 9) so that t1 and t2 can be re-determined, andadjustment algorithm 170 repeated.

If PWa<t1, the adjustment algorithm 170 can continue by assessingwhether the duration of both pulse phases is less than t2, i.e., ifPWa+PWb>t2. (Alternatively, if a significant interphase period IP isused between phases 30 a and 30 b, the algorithm 170 can inquire whetherPWa+IP+PWb>t2). If this is true, then the ECAP at the sensing electrodeshould fall entirely within the prescribed second phase 30 b. In thiscase, the IPG can simply provide the stimulation, and sense the ECAPduring the second pulse phase 30 b at the sensing electrode S+,similarly to what was shown in FIG. 8. Passive charge recovery duringperiod 30 c can then be performed after the second pulse phase 30 iscomplete, which will not conflict with the already-sensed ECAP.

If PWa+PWb is not greater than t2, this means that the second phase 30 bends somewhere in the middle of when the ECAP is expected to be presentat the sensing electrode S+, which as noted earlier can be problematicbecause the stimulation artifact 134 would be changing during thetransition. The adjustment algorithm 170 can thus adjust the timing ofthe second phase 30 b by increasing PWb to PWb′ so that PWa+PWb′ is nowgreater than t2. At this point, the ECAP at the sensing electrode shouldfall entirely within the adjusted second phase 30 b. The adjustmentalgorithm 170 can then adjust the amplitude of the second phase 30 b toensure that the adjusted second phase 30 b is charge balanced with thefirst phase 30 a. Thus, a new (lower) amplitude |Ab′| is chosen for thesecond phase such that |Aa|*PWa=|Ab′|*PWb′—i.e., |Ab′| is set equal to|Aa|*PWa divided by the adjusted pulse width PWb′. After this adjustmentto the second phase 30 b is made, the IPG can provide the stimulation,and sense the ECAP during the adjusted second pulse phase 30 b at thesensing electrode S+, followed by passive charge recovery 30 c ifdesired.

Although algorithms 150 and 170 are described as separate for ease ofillustration, they could be combined into a single algorithm.

FIG. 10B shows an alternative adjustment algorithm 170′ which canalternatively change the selected sensing electrode S+ to ensure thatthe ECAP is present at the sensing electrode during the entirety of thesecond phase 30 b. If PWa is not less than t1, or if PWa+PWb is notgreater than t2, the adjustment algorithm 170′ can choose a new sensingelectrode (e.g., E9) that is farther from the stimulating electrodes.Again, choosing a new sensing electrodes would change timings t1 and t2,and therefore the newly chosen sensing electrode S+ can be passed backto the timing algorithm 150 (FIG. 9) so that t1 and t2 can bere-determined, and adjustment algorithm 170′ repeated. After suchiteration(s), if PWa is less than t1, and if PWa+PWb is greater than t2,then the ECAP should be present at the (new) sensing electrode S+ duringthe second phase 30 b, and so stimulation and sensing can be provided,followed by passive charge recovery.

Although not shown in the figures, realize that adjustment algorithms170 (FIG. 10A) and 170′ (FIG. 10B) can each be run, or run concurrently,with 170 being used to adjust the second pulse phase 30 b, and 170′adjusting the sensing electrode S+. As such, adjustment using algorithms170 and 170′ can be an iterative process, with the effect of ensuringthat the ECAP will be present and easily sensed at the sensing electrodeS+ during the second phase 30 b, as per FIG. 8.

As shown in FIG. 4, the timing and adjustment algorithms can comprisepart of the ECAP algorithm 124 operable in the control circuitry 102(FIG. 4). However, these algorithms can also operate in whole or in partin external computer devices 158 that are used to program the IPG, suchas a patient's external controller or a clinician programmer. Suchexternal devices 158 typically wirelessly communicate with an IPG 100,and are described in U.S. Patent Application Publication 2019/0046800,which is incorporated herein by reference in its entirety. A GraphicalUser Interface (GUI) 160 as rendered on such an external device 158 isshown in FIG. 11. Shown in GUI 160 are user selectable options 162 toset stimulation parameters for the pulses or pulse phases of IPG, suchas amplitude (A), pulse width (PW), and frequency (F), as well aswhether certain electrodes are to operate as anodes or cathodes, and apercentage of the amplitude (X%) to be applied to that electrode. Inreality, the GUI 160 and 162 may be much more complicated than what isshown.

The GUI 160 can include an option 164 to modify pulses otherwiseprescribed into pulses better suited to ECAP sensing—such as by adding asecond pulse phase 30 b, or modifying an already—prescribed second pulsephase 30 b, to overlap with the ECAP at the sensing electrode as shownin FIG. 8 and in other subsequent examples. Selection of option 164 mayuse the timing and adjustment algorithms of FIGS. 9-10B, or otheralgorithms, to determine the necessary pulse parameters to achieve thisgoal, and to send these pulse parameters to the IPG. If necessary, theIPG may communicate ECAP test measurements back to the algorithms, suchas ECAP start and finish times t1 and t2 as measured at the sensingelectrode S+. The algorithms can be stored in non-transitorymachine-readable media in the external device 158, such in as magnetic,optical, or solid-state memories, which may be stored in associationwith the external device 158's control circuitry 166, which may compriseone or more microcontrollers, microprocessors, FPGAs, DSPs, etc. In oneexample, control circuitry 166 can comprise one of the i5 family ofmicroprocessors, as manufactured by Intel Corp.

FIG. 12 shows another manner in which the second pulse phase 30 b can beadjusted, and specifically shows adjustment of only a portion of thesecond phase 30 b. The left of FIG. 12 shows pulses prior to adjustment,and notice in this situation that the ECAP starts to be present at thesensing electrode (t1) in the middle of the second pulse phase 30 b.

In this circumstance, the second pulse phase 30 b can be split into twosub-phases 30 b 1 and 30 b 2. Sub-phase 30 b 1 can precede t1 (with apulse width of PWb1), and—because the ECAP is not yet present at thesensing electrode S+—can be larger in magnitude. For example, if phase30 b prior to adjustment has a magnitude of |−Ab|, the magnitude duringsub-phase 30 b 1 can be |−Ab1|, which may equal un-adjusted amplitude|−Ab|, or be smaller or larger, but still relatively large. This allowsa significant portion of charge injected during the first phase 30 a(|Aa|*PWa=|+Q|, at E4), but perhaps not all, to be actively recoveredduring this sub-phase 30 b 1.

Sub-phase 30 b 2 starts at or before t1, when the ECAP would start to bepresent at the sensing electrode S+. Sub-phase 30 b 2 should continuefor a duration (PWb2) sufficient to cover the ECAP at the sensingelectrode—i.e., sub-phase 30 b 2 should last at least until t2 when theECAP is finishing at the sensing electrode S+. The amplitude |−Ab2| ofsub-phase 30 b 2 may be set to ensure that sub-phases 30 b 1 and 30 b 2are charge balanced with the first phase 30 a. In other words, once Ab1,PWb1 and PWb2 are set, amplitude Ab2 is selected such that|+Aa|*PWa=|−Ab1|*PWb1+|−Ab2|*PWb2. Notice that splitting second phase 30b into sub-phases 30 b 1 and 30 b 2 can allow the amplitude ofstimulation during the ECAP—i.e., |Ab2| to be significantly reduced.This reduces the magnitude of the stimulation artifact 134 during ECAPsensing, which makes such sensing easier. Notice also that thestimulation artifact 134 is not significantly changing during sub-phase30 b 2 when the ECAP is being sensed.

FIGS. 13A-13D show different examples similar to FIG. 12 in which thesecond phase 30 b is divided into sub-phases having different amplitudesand durations. FIG. 13A shows the example of FIG. 12 again, showing onlythe pulse as present at electrode E4 and the ECAP at sensing electrodeE8 (artifacts not shown). FIG. 13B shows that a lower-amplitudesub-phase 30 b 1 can precede a higher-amplitude sub-phase 30 b 2. Thisallows the ECAP to be sensed during sub-phase 30 b 1 when thestimulation artifact would be lowest, and so sub-phase 30 b 1 in thisinstance is long enough to completely overlap with the ECAP at thesensing electrode S+. Higher-amplitude sub-phase 30 b 2 will provide themajority of active charge recovery after the sub-phase 30 b 1, thusallowing phase 30 a to be charge balanced with the sum of sub-phases 30b 1 and 30 b 2.

In FIG. 13C, phase 30 b is split into three sub-phases 30 b 1, 30 b 2,and 30 b 3. Sensing of the ECAP occurs during the middle sub-phase 30 b2, which preferably has the lowest amplitude of the sub-phases, andhence will result in the lowest stimulation artifact 134.Higher-amplitude sub-phases 30 b 1 and 30 b 2 respectively precede andfollow sub-phase 30 b 2, thus allowing the majority of active chargerecovery to occur during those sub-phases. Again, the pulse is chargebalanced, with the charge during phase 30 a equaling the sum of thecharge at phases 30 b 1, 30 b 2, and 30 b 3.

FIG. 13D is similar to FIG. 13A, but shows that the current need not beconstant during the higher amplitude sub-phases. In this example, thecurrent during higher-amplitude sub-phase 30 b 1 is not constant, andthis could also be true for the higher-amplitude sub-phases of FIGS. 13Band 13C as well. The current may also not be constant during thelower-amplitude sub-phase 30 b 2 when the ECAP is sensed, but a constantcurrent is preferable so that the stimulation artifact 134 will berelatively constant, which as noted earlier eases ECAP sensing. In allof the examples of FIGS. 13A-13D, passive charge recovery 30 c canfollow the second pulse phase 30 b. Note also that the amplitude of thefirst phase 30 a does not have to be constant in any of the examplesdisclosed herein.

FIGS. 14A and 14B show that there can be a significant gap 180 in timebetween the first and second pulse phases 30 a and 30 b during which noactive charge is driven by the DAC circuitry (40/42; FIG. 4). This gap180 can be significantly longer than the short interphase period that istypically present between first and second phases 30 a and 30 b in abiphasic pulse. Use of a longer gap 180 can be warranted if the ECAPwill reach the sensing electrodes at later times—i.e., if t1 and t2 arelonger. In this instance, the second pulse phase 30 b is timed to againcover the ECAP at the sensing electrode. In FIG. 14A, nothing occursduring the gap 180, and passive charge recovery 30 c occurs after thesecond phase 30 b. In FIG. 14B, passive charge recovery 30 c occursduring at least a portion of the gap 180. This allows some chargeinjected during the first phase 30 a to be passively recovered prior toactive charge recovery that would occur during the second active phase30 b. Passive charge recovery could also occur (or continue) after thesecond phase 30 b in FIG. 14B, although this isn't shown.

It should be noted that use of an extended second phase 30 b as shown invarious examples need not result from the modification of an otherwiseinitial biphasic pulse. Instead, extended second pulse phases 30 b maybe added to monophasic pulses. Thus, in the various examples, onlymonophasic pulses 30 a may be prescribed, with extended second activephases 30 b of low amplitude added specifically for the purpose ofassisting in ECAP sensing. It can be useful to add such second phases 30b to monophasic pulses simply for the purpose of producing a smallerconstant stimulation artifact 134 more conducive with ECAP sensing.Further, while it may be preferable that the actively-driven secondphase 30 b always be charge balanced with the actively-driven firstphase 30 a, these phases may also not be charge balanced, and this isparticularly true if passive charge recovery 30 c is used to recover anyremaining charged not actively recovered. Further, and realizing thatpassive charge recovery can be used, it is not strictly necessary thatthe first and second pulses phases 30 a and 30 b be of differingpolarities at the electrodes, although this is preferred to provide atleast some amount of active charge recovery. While first pulse phase 30a is preferably actively driven, this is not strictly required, andinstead the first pulse phase 30 a can be passively driven as well.

As noted earlier, an ECAP is just one example of a neural response thatcan be sensed using the disclosed techniques.

Although particular embodiments of the present invention have been shownand described, the above discussion is not intended to limit the presentinvention to these embodiments. It will be obvious to those skilled inthe art that various changes and modifications may be made withoutdeparting from the spirit and scope of the present invention. Thus, thepresent invention is intended to cover alternatives, modifications, andequivalents that may fall within the spirit and scope of the presentinvention as defined by the claims.

What is claimed is:
 1. A stimulator device, comprising: a plurality ofelectrode nodes, each electrode node configured to be coupled to one ofa plurality of electrodes configured to contact a patient's tissue;stimulation circuitry programmed to form stimulation at at least two ofthe electrode nodes, wherein the stimulation at each of the twoelectrode nodes comprises a pulse comprising a first phase followed by asecond phase; and sensing circuitry configured to sense a neuralresponse to the stimulation at a sensing electrode node comprising oneof the electrode nodes, wherein the neural response is present at thesensing electrode node for a duration, wherein the sensing circuitry isconfigured to sense the neural response during the second phase.
 2. Thestimulation device of claim 1, wherein the sensing electrode node isselectable from one of the electrode nodes.
 3. The stimulation device ofclaim 1, wherein the sensing circuitry is configured to sense the entireduration of the neural response during the second phase.
 4. Thestimulation device of claim 1, wherein the sensing circuitry comprises adifferential amplifier, and wherein the differential amplifier receivesthe sensing electrode node at a first input, and wherein thedifferential amplifier receives a reference electrode node selected fromone of the electrode nodes at a second input.
 5. The stimulation deviceof claim 4, further comprising a conductive case for housing thestimulation circuitry and the sensing circuitry, wherein the conductivecase comprises one of the plurality of electrodes, and wherein the caseelectrode is coupled to the reference electrode node.
 6. The stimulationdevice of claim 1, wherein the first phase is of an opposite polarity tothe second phase at each of the at least two electrode nodes.
 7. Thestimulation device of claim 1, wherein the first and second phases arecharge balanced at each of the at least two electrodes.
 8. Thestimulation device of claim 1, wherein the first and second phases arenot charge balanced at each of the at least two electrodes.
 9. Thestimulation device of claim 1, further comprising control circuitryconfigured with at least one algorithm, wherein the at least onealgorithm is configured to determine when the neural response will bepresent at the sensing electrode node for the duration.
 10. Thestimulation device of claim 9, wherein the at least one algorithm isfurther configured to time the second phase at the at least twoelectrode nodes such that the second phase will entirely overlap theneural response at the sensing electrode node for the duration.
 11. Thestimulation device of claim 10, wherein the algorithm is furtherconfigured to determine an amplitude of the second phase.
 12. Thestimulation device of claim 11, wherein the algorithm is furtherconfigured to determine the amplitude of the second phase such that thesecond phase is charge balanced with the first phase at each of the atleast two electrodes nodes.
 13. The stimulation device of claim 1,wherein the stimulation circuitry comprises digital-to-analog circuitryconfigured to actively drive a current, wherein the second phase isactively driven by the digital-to-analog circuitry at each of the atleast two electrode nodes.
 14. The stimulation device of claim 13,wherein the second phase is actively driven with a constant current. 15.The stimulation device of claim 13, wherein the first phase is activelydriven by the digital-to-analog circuitry at each of the at least twoelectrode nodes.
 16. The stimulation device of claim 15, wherein thefirst and second phases are actively driven by the digital-to-analogcircuitry with constant currents, wherein an amplitude of the constantcurrent during the first phase is larger than an amplitude of theconstant current during the second phase at each of the at least twoelectrode nodes.
 17. The stimulation device of claim 1, wherein thesecond phase comprises sub-phases of different amplitudes, wherein thesensing circuitry is configured to sense the neural response only duringone of the sub-phases.
 18. The stimulation device of claim 13, whereinthe stimulation circuitry comprises a plurality of passive chargerecovery switches each coupled between one of the electrode nodes and areference potential.
 19. The stimulation device of claim 18, wherein thestimulation circuitry is further programmed to provide passive chargerecovery after the second phase by closing at least the passive recoveryswitches coupled to the at least two electrode nodes.
 20. Thestimulation device of claim 18, wherein the stimulation circuitry isfurther programmed to provide passive charge recovery between the firstand second phases by closing at least the passive recovery switchescoupled to the at least two electrode nodes.